﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
    <script>
        var entity = {};
        layui.use(['jquery', 'form', 'laydate', 'common', 'optimizeSelectOption'], function () {
            var form = layui.form,
                $ = layui.$,
                common = layui.common,
                laydate = layui.laydate;
            var event = $.request("event");
            //权限字段
            common.authorizeFields('adminform');
            if (!!entity) {
                $('#F_EnCode').val(entity.TableColumn);
                $('#F_FullName').val(entity.Remark);
            }
            form.render();
            wcLoading.close();
            //监听提交
            var lock = false;
            form.on('submit(saveBtn)', function (data) {
                if (!lock) {
                    lock = true;
                    var valuedata = data.field.F_NewName;
                    common.currentWindow().$('#' + event).html(valuedata);
                    common.modalMsg("修改成功!", "success");
                    common.modalClose();
                    lock = false;
                }
                return false;
            });
        });
        function initForm(data) {
            entity = data;
        }
    </script>
<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form " lay-filter="adminform">
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">编号</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_EnCode" name="F_EnCode" maxlength="50" readonly class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_FullName" name="F_FullName" maxlength="50" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label required">新名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_NewName" name="F_NewName" maxlength="50" lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <button class="layui-btn" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</body>
